package swing;

import javax.swing.*;
import java.awt.*;

public class Demo2 extends JFrame {
    public Demo2(){
        setBounds(100,100,200,200);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        Container c =getContentPane();
        setVisible(true);


        JLabel l =new JLabel("这是一个标签");
        l.setText("更改标签内容");
        l.setFont(new Font("华文新魏",Font.BOLD,26));
        l.setForeground(Color.green);
        c.add(l);
    }

    public static void main(String[] args) {
        new Demo2();
    }
}
